// Check dumping of the .rsrc section(s)
// The input was generated with the following commands, using the original Windows
// rc.exe and cvtres.exe:
// > rc /fo test_resource.res /nologo test_resource.rc
// > cvtres /machine:X86 /readonly /nologo /out:test_resource.o test_resource.res

RUN: llvm-readobj --coff-resources --section-data %p/Inputs/zero-string-table.obj.coff-i386 \
RUN:   | FileCheck %s -check-prefix ZERO
RUN: llvm-readobj --coff-resources %p/Inputs/resources/test_resource.obj.coff \
RUN:   | FileCheck %s -check-prefix TEST_RES

ZERO:     Resources [
ZERO-NEXT:  Total Number of Resources: 1
ZERO-NEXT:  Base Table Address: 0x188
ZERO-DAG:   Number of String Entries: 0
ZERO-NEXT:  Number of ID Entries: 1
ZERO-NEXT:  Type: STRINGTABLE (ID 6) [
ZERO-NEXT:    Table Offset: 0x18
ZERO-NEXT:    Number of String Entries: 0
ZERO-NEXT:    Number of ID Entries: 1
ZERO-NEXT:    Name: (ID 1) [
ZERO-NEXT:      Table Offset: 0x30
ZERO-NEXT:      Number of String Entries: 0
ZERO-NEXT:      Number of ID Entries: 1
ZERO-NEXT:      Language: (ID 1033) [
ZERO-NEXT:        Entry Offset: 0x48
ZERO-NEXT:        Time/Date Stamp: 1970-01-01 00:00:00 (0x0)
ZERO-NEXT:        Major Version: 0
ZERO-NEXT:        Minor Version: 0
ZERO-NEXT:        Characteristics: 0
ZERO-NEXT:        Data [
ZERO-NEXT:          DataRVA: 0x0
ZERO-NEXT:          DataSize: 42
ZERO-NEXT:          Codepage: 0
ZERO-NEXT:          Reserved: 0
ZERO-NEXT:          Data (
ZERO-NEXT:            0000: 00000500 48006500 6C006C00 6F000000  |....H.e.l.l.o...|
ZERO-NEXT:            0010: 00000000 00000000 00000000 00000000  |................|
ZERO-NEXT:            0020: 00000000 00000000 0000               |..........|
ZERO-NEXT:          )
ZERO-NEXT:        ]
ZERO-NEXT:      ]
ZERO-NEXT:    ]
ZERO-NEXT:  ]

TEST_RES:     Resources [
TEST_RES-NEXT:  Total Number of Resources: 7
TEST_RES-NEXT:  Base Table Address: 0x1C0  
TEST_RES-DAG:   Number of String Entries: 0
TEST_RES-NEXT:  Number of ID Entries: 4
TEST_RES-NEXT:  Type: BITMAP (ID 2) [
TEST_RES-NEXT:    Table Offset: 0x30
TEST_RES-NEXT:    Number of String Entries: 2
TEST_RES-NEXT:    Number of ID Entries: 0
TEST_RES-NEXT:    Name: CURSOR [
TEST_RES-NEXT:      Table Offset: 0xA8
TEST_RES-NEXT:      Number of String Entries: 0
TEST_RES-NEXT:      Number of ID Entries: 1
TEST_RES-NEXT:      Language: (ID 1033) [
TEST_RES-NEXT:        Entry Offset: 0x150
TEST_RES-NEXT:        Time/Date Stamp: 1970-01-01 00:00:00 (0x0)
TEST_RES-NEXT:        Major Version: 0
TEST_RES-NEXT:        Minor Version: 0
TEST_RES-NEXT:        Characteristics: 0
TEST_RES-NEXT:        Data [
TEST_RES-NEXT:          DataRVA: 0x0
TEST_RES-NEXT:          DataSize: 808
TEST_RES-NEXT:          Codepage: 0
TEST_RES-NEXT:          Reserved: 0
TEST_RES-NEXT:          Data (
TEST_RES:               )
TEST_RES-NEXT:        ]
TEST_RES-NEXT:      ]
TEST_RES-NEXT:    ]
TEST_RES-NEXT:    Name: OKAY [
TEST_RES-NEXT:      Table Offset: 0xC0
TEST_RES-NEXT:      Number of String Entries: 0
TEST_RES-NEXT:      Number of ID Entries: 1
TEST_RES-NEXT:      Language: (ID 1033) [
TEST_RES-NEXT:        Entry Offset: 0x160
TEST_RES-NEXT:        Time/Date Stamp: 1970-01-01 00:00:00 (0x0)
TEST_RES-NEXT:        Major Version: 0
TEST_RES-NEXT:        Minor Version: 0
TEST_RES-NEXT:        Characteristics: 0
TEST_RES-NEXT:        Data [
TEST_RES-NEXT:          DataRVA: 0x0
TEST_RES-NEXT:          DataSize: 808
TEST_RES-NEXT:          Codepage: 0
TEST_RES-NEXT:          Reserved: 0
TEST_RES-NEXT:          Data (
TEST_RES:               )
TEST_RES-NEXT:        ]
TEST_RES-NEXT:      ]
TEST_RES-NEXT:    ]
TEST_RES-NEXT:  ]
TEST_RES-NEXT:  Type: MENU (ID 4) [
TEST_RES-NEXT:    Table Offset: 0x50
TEST_RES-NEXT:    Number of String Entries: 1
TEST_RES-NEXT:    Number of ID Entries: 1
TEST_RES-NEXT:    Name: "EAT" [
TEST_RES-NEXT:      Table Offset: 0xD8
TEST_RES-NEXT:      Number of String Entries: 0
TEST_RES-NEXT:      Number of ID Entries: 1
TEST_RES-NEXT:      Language: (ID 3081) [
TEST_RES-NEXT:        Entry Offset: 0x170
TEST_RES-NEXT:        Time/Date Stamp: 1970-01-01 00:00:00 (0x0)
TEST_RES-NEXT:        Major Version: 0
TEST_RES-NEXT:        Minor Version: 0
TEST_RES-NEXT:        Characteristics: 0
TEST_RES-NEXT:        Data [
TEST_RES-NEXT:          DataRVA: 0x0
TEST_RES-NEXT:          DataSize: 48
TEST_RES-NEXT:          Codepage: 0
TEST_RES-NEXT:          Reserved: 0
TEST_RES-NEXT:          Data (
TEST_RES:               )
TEST_RES-NEXT:        ]
TEST_RES-NEXT:      ]
TEST_RES-NEXT:    ]
TEST_RES-NEXT:    Name: (ID 14432) [
TEST_RES-NEXT:      Table Offset: 0xF0
TEST_RES-NEXT:      Number of String Entries: 0
TEST_RES-NEXT:      Number of ID Entries: 1
TEST_RES-NEXT:      Language: (ID 2052) [
TEST_RES-NEXT:        Entry Offset: 0x180
TEST_RES-NEXT:        Time/Date Stamp: 1970-01-01 00:00:00 (0x0)
TEST_RES-NEXT:        Major Version: 0
TEST_RES-NEXT:        Minor Version: 0
TEST_RES-NEXT:        Characteristics: 0
TEST_RES-NEXT:        Data [
TEST_RES-NEXT:          DataRVA: 0x0
TEST_RES-NEXT:          DataSize: 46
TEST_RES-NEXT:          Codepage: 0
TEST_RES-NEXT:          Reserved: 0
TEST_RES-NEXT:          Data (
TEST_RES:               )
TEST_RES-NEXT:        ]
TEST_RES-NEXT:      ]
TEST_RES-NEXT:    ]
TEST_RES-NEXT:  ]
TEST_RES-NEXT:  Type: DIALOG (ID 5) [
TEST_RES-NEXT:    Table Offset: 0x70
TEST_RES-NEXT:    Number of String Entries: 1
TEST_RES-NEXT:    Number of ID Entries: 0
TEST_RES-NEXT:    Name: TESTDIALOG [
TEST_RES-NEXT:      Table Offset: 0x108
TEST_RES-NEXT:      Number of String Entries: 0
TEST_RES-NEXT:      Number of ID Entries: 1
TEST_RES-NEXT:      Language: (ID 1033) [
TEST_RES-NEXT:        Entry Offset: 0x190
TEST_RES-NEXT:        Time/Date Stamp: 1970-01-01 00:00:00 (0x0)
TEST_RES-NEXT:        Major Version: 0
TEST_RES-NEXT:        Minor Version: 0
TEST_RES-NEXT:        Characteristics: 0
TEST_RES-NEXT:        Data [
TEST_RES-NEXT:          DataRVA: 0x0
TEST_RES-NEXT:          DataSize: 108
TEST_RES-NEXT:          Codepage: 0
TEST_RES-NEXT:          Reserved: 0
TEST_RES-NEXT:          Data (
TEST_RES:               )
TEST_RES-NEXT:        ]
TEST_RES-NEXT:      ]
TEST_RES-NEXT:    ]
TEST_RES-NEXT:  ]
TEST_RES-NEXT:  Type: ACCELERATOR (ID 9) [
TEST_RES-NEXT:    Table Offset: 0x88
TEST_RES-NEXT:    Number of String Entries: 1
TEST_RES-NEXT:    Number of ID Entries: 1
TEST_RES-NEXT:    Name: MYACCELERATORS [
TEST_RES-NEXT:      Table Offset: 0x120
TEST_RES-NEXT:      Number of String Entries: 0
TEST_RES-NEXT:      Number of ID Entries: 1
TEST_RES-NEXT:      Language: (ID 1033) [
TEST_RES-NEXT:        Entry Offset: 0x1A0
TEST_RES-NEXT:        Time/Date Stamp: 1970-01-01 00:00:00 (0x0)
TEST_RES-NEXT:        Major Version: 0
TEST_RES-NEXT:        Minor Version: 0
TEST_RES-NEXT:        Characteristics: 0
TEST_RES-NEXT:        Data [
TEST_RES-NEXT:          DataRVA: 0x0
TEST_RES-NEXT:          DataSize: 24
TEST_RES-NEXT:          Codepage: 0
TEST_RES-NEXT:          Reserved: 0
TEST_RES-NEXT:          Data (
TEST_RES:               )
TEST_RES-NEXT:        ]
TEST_RES-NEXT:      ]
TEST_RES-NEXT:    ]
TEST_RES-NEXT:    Name: (ID 12) [
TEST_RES-NEXT:      Table Offset: 0x138
TEST_RES-NEXT:      Number of String Entries: 0
TEST_RES-NEXT:      Number of ID Entries: 1
TEST_RES-NEXT:      Language: (ID 1033) [
TEST_RES-NEXT:        Entry Offset: 0x1B0
TEST_RES-NEXT:        Time/Date Stamp: 1970-01-01 00:00:00 (0x0)
TEST_RES-NEXT:        Major Version: 0
TEST_RES-NEXT:        Minor Version: 0
TEST_RES-NEXT:        Characteristics: 0
TEST_RES-NEXT:        Data [
TEST_RES-NEXT:          DataRVA: 0x0
TEST_RES-NEXT:          DataSize: 24
TEST_RES-NEXT:          Codepage: 0
TEST_RES-NEXT:          Reserved: 0
TEST_RES-NEXT:          Data (
TEST_RES:               )
TEST_RES-NEXT:        ]
TEST_RES-NEXT:      ]
TEST_RES-NEXT:    ]
TEST_RES-NEXT:  ]
